package bg.ittalents.homework.airport;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Scanner;

public class Demo {
	public static void main(String[] args) throws FileNotFoundException,
			UnsupportedEncodingException {

		File input = new File("trafficSheet.txt");
		String outputFile = "output.txt";

		Scanner scan = new Scanner(input);

		int tracksCount = scan.nextInt();
		int capacity = scan.nextInt();
		int timeToLand = scan.nextInt();
		scan.close();

		FileLogger logger = new FileLogger(outputFile);
		FileReader reader = null;

		try {
			reader = new FileReader("trafficSheet.txt");
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		LoggingDispatcher dispatcher = new LoggingDispatcher(tracksCount, logger,
				reader, timeToLand, capacity);

		Airport port = new Airport(dispatcher);

		port.executeSchedule();

	}
}
